# Copyright 2022 hpmicro
# SPDX-License-Identifier: BSD-3-Clause

cmake_minimum_required(VERSION 3.13)

set(CONFIG_SDMMC 1)
set(CONFIG_FATFS 1)

set(CUSTOM_GCC_LINKER_FILE ../linkers/segger/bootuser.icf)
set(HPM_SDK_NO_NANO_SPECS 1)
# set(FLASH_XIP 1)
# set(LINK_TO_FLASH 1)
set(INCLUDE_BOOTHEADER 1)

find_package(hpm-sdk REQUIRED HINTS $ENV{HPM_SDK_BASE})

sdk_compile_definitions(-DFLASH_XIP=1)
sdk_compile_definitions(-DBOARD_SHOW_CLOCK=0)

project(boot_user_uart)

sdk_inc(../common)
sdk_inc(inc)


sdk_app_src(../common/boot_user.c)
sdk_app_src(../common/ota_api.c)
sdk_app_src(../common/user_signature.c)
sdk_app_src(../common/ota_verify.c)
sdk_app_src(src/uart_xmodem.c)
sdk_app_src(src/main.c)
sdk_app_src(src/tf_fatfs_ota.c)

generate_ses_project()
